/*
 * @Author: tangyuhui 317972442@qq.com
 * @Date: 2024-08-26 14:36:05
 * @LastEditors: tangyuhui 317972442@qq.com
 * @LastEditTime: 2024-08-30 00:25:06
 */
import { defineConfig } from "vite";
import { resolve } from "path";
import react from "@vitejs/plugin-react";
import copy from "rollup-plugin-copy";
import styleImport from "vite-plugin-style-import"

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      "@": resolve(__dirname, "src"),
    },
  },
  plugins: [
    styleImport({
      libs: [
        {
          libraryName: "antd",
          esModule: true,
          resolveStyle: (name) => `antd/es/${name}/style/css`,
        },
      ],
    })],
  build: {
    rollupOptions: {
      input: ["src/contentScript.tsx"],
      output: {
        chunkFileNames: "[name].[hash].js",
        assetFileNames: "[name].[hash].[ext]",
        entryFileNames: "[name].js",
        dir: "distiife",
        format: 'iife',
      }
    },
  },
});